package xju_9_10.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import xju_9_10.entity.Stu;
import xju_9_10.entity.Student;

@Repository
public class StudentDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void save(Stu student) {
        String sql = "insert into student(name,sn,card_id,clazz_id) values(?,?,?,?)";
        jdbcTemplate.update(sql,student.getName(),student.getSn(),student.getCardId(),student.getClazzId());
    }
}
